package com.rivulet.fileserver.tools;

import java.io.Serializable;

/**
 * {按格式封装返回数据}
 *
 */
public class Results<Type> implements Serializable {
    private static final long serialVersionUID = 1L;
    private String msg = "无效操作！";
    private Integer code;
    private Type data;

    public Results(Integer code, Type data) {
        this.code = code;
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Type getData() {
        return data;
    }

    public void setData(Type data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "Results{" +
                "msg='" + msg + '\'' +
                ", code=" + code +
                ", data=" + data +
                '}';
    }
}
